<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>简单导航安装向导</title>
    <script type="text/javascript" src="./js/jquery-2.0.0.min.js"></script>
    <link rel="stylesheet" type="text/css" href="./css/bootstrap.min.css">
    <link rel="stylesheet" href="./css/install.css">
<script>
    if(top.location != self.self.location){  //判断是否存在父窗口
        top.location.reload();
    }
    function testClick(){
        if($('.yes').length != 9){
            alert('您的配置或权限不符合要求');
        }else{
            location.href='./index.php?c=create';
        }
    }
</script>
</head>
<body>
<div id="nav">
    <div class="inside">
        <p class="name">简单导航安装向导</p>
        <ul class="schedule active">
            <li class="number">1</li>
            <li class="word">环境检测</li>
        </ul>
        <ul class="schedule">
            <li class="number">2</li>
            <li class="word">创建数据</li>
        </ul>
        <ul class="schedule">
            <li class="number">3</li>
            <li class="word">安装完成</li>
        </ul>
    </div>
</div>
<div id="out">
    <div class="inside">

        <div class="box test">
            <h2>环境必须</h2>
            <table class="table table-border">
                <tr>
                    <th width="50%">必装坏境</th>
                    <th width="50%">最低版本</th>
                </tr>
                <tr>
                    <td>PHP</td>
                    <td>7.0</td>
                </tr>
                <tr>
                    <td>MySQL</td>
                    <td>5.6</td>
                </tr>
            </table>
            <h2>环境监测</h2>
            <table class="table table-border">
                <tr>
                    <th width="25%">坏境</th>
                    <th width="25%">最低配置</th>
                    <th width="25%">当前配置</th>
                    <th width="25%">是否符合</th>
                </tr>
                <tr>
                    <td>操作系统</td>
                    <td>不限</td>
                    <td><?php echo php_uname('s'); ?></td>
                    <td class="yes">√</td>
                </tr>
                <tr>
                    <td>php版本</td>
                    <td>&gt;7.0</td>
                    <td><?php echo PHP_VERSION ?></td>
                    <?php $php_version=explode('.', PHP_VERSION); ?>
                    <td class="<?php if(($php_version['0']>=7 && $php_version['1']>=0))echo 'yes'; ?>">
                        <?php if (($php_version['0']>=7 && $php_version['1']>=0)): ?>
                            √
                        <?php else: ?>
                            ×
                        <?php endif ?>
                    </td>
                </tr>
                <tr>
                    <td>mysqli</td>
                    <td>支持</td>
                    <td>
                        <?php if (function_exists ('mysqli_connect')): ?>
                        支持
                        <?php else: ?>
                        不支持
                        <?php endif ?>
                    </td>
                    <td class="<?php if(function_exists ('mysqli_connect'))echo 'yes'; ?>">
                        <?php if (function_exists ('mysqli_connect')): ?>
                        √
                        <?php else: ?>
                        ×
                        <?php endif ?>
                    </td>
                </tr>
                <tr>
                    <td>PDO</td>
                    <td>支持</td>
                    <td>
                        <?php if (class_exists('PDO', false)): ?>
                        支持
                        <?php else: ?>
                        不支持
                        <?php endif ?>
                    </td>
                    <td class="<?php if(class_exists('PDO', false))echo 'yes'; ?>">
                        <?php if (class_exists('PDO', false)): ?>
                        √
                        <?php else: ?>
                        ×
                        <?php endif ?>
                    </td>
                </tr>
                <tr>
                    <td>pdo_mysql</td>
                    <td>支持</td>
                    <td>
                        <?php if (extension_loaded('pdo_mysql')): ?>
                        支持
                        <?php else: ?>
                        不支持
                        <?php endif ?>
                    </td>
                    <td class="<?php if(extension_loaded('pdo_mysql'))echo 'yes'; ?>">
                        <?php if (extension_loaded('pdo_mysql')): ?>
                        √
                        <?php else: ?>
                        ×
                        <?php endif ?>
                    </td>
                </tr>
            </table>
            <h2>目录权限</h2>
            <table class="table table-border">
                <tr>
                    <th width="25%">坏境</th>
                    <th width="25%">最低配置</th>
                    <th width="25%">当前配置</th>
                    <th width="25%">是否符合</th>
                </tr>
                <tr>
                    <td>./</td>
                    <td>可写</td>
                    <td>
                        <?php if (is_writable('../../')): ?>
                            可写
                        <?php else: ?>
                            不可写
                        <?php endif ?>
                    </td>
                    <td class="<?php if(is_writable('../../'))echo 'yes'; ?>">
                        <?php if (is_writable('../../')): ?>
                            √
                        <?php else: ?>
                            ×
                        <?php endif ?>
                    </td>
                </tr>


                
                <tr>
                    <td>./install</td>
                    <td>可写</td>
                    <td>
                        <?php if (is_writable('../install')): ?>
                            可写
                        <?php else: ?>
                            不可写
                        <?php endif ?>
                    </td>
                    <td class="<?php if(is_writable('../install'))echo 'yes'; ?>">
                        <?php if (is_writable('../install')): ?>
                            √
                        <?php else: ?>
                            ×
                        <?php endif ?>
                    </td>
                </tr>
                <tr>
                    <td>./config</td>
                    <td>可写</td>
                    <td>
                        <?php if (is_writable('../../config')): ?>
                        可写
                        <?php else: ?>
                        不可写
                        <?php endif ?>
                    </td>
                    <td class="<?php if(is_writable('../../config'))echo 'yes'; ?>">
                        <?php if (is_writable('../../config')): ?>
                        √
                        <?php else: ?>
                        ×
                        <?php endif ?>
                    </td>
                </tr>
                <tr>
                    <td>./config/extra</td>
                    <td>可写</td>
                    <td>
                        <?php if (is_writable('../../config/extra')): ?>
                            可写
                        <?php else: ?>
                            不可写
                        <?php endif ?>
                    </td>
                    <td class="<?php if(is_writable('../../config/extra'))echo 'yes'; ?>">
                        <?php if (is_writable('../../config/extra')): ?>
                            √
                        <?php else: ?>
                            ×
                        <?php endif ?>
                    </td>
                </tr>
            </table>
            <p class="agree">
                <a class="btn btn-success" href="javascript:;" onclick="testClick()">下一步</a>
            </p>
        </div>
    </div>
</div>

</body>
</html>
